package com.coderush.admin.sys.model.dto;

import com.alibaba.fastjson2.JSON;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * PackageName com.coderush.admin.sys.model.dto
 *
 * @Author Eason
 * @Version v1.0
 * @ClassName DepartmentAddDto
 * @Date 2025/8/25
 * @Description TODO
 */
@Data
@Schema(description = "添加公司部门数据模型")
public class DepartmentAddDto {

    /**
     * 所属公司ID
     */
    @Schema(description = "公司ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "公司ID不能为空")
    private Long companyId;

    /**
     * 部门编码，唯一，用于系统识别（如：HR-001、FIN-002）
     */
    @Schema(description = "部门编码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "部门编码不能为空，且全局唯一")
    private String deptCode;

    /**
     * 部门名称（如：人力资源部、财务部）
     */
    @Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "部门名称不能为空")
    private String deptName;

    /**
     * 部门负责人ID（关联员工表 employee.id）
     */
    @Schema(description = "部门负责人ID")
    private Long leaderId = 0L;

    /**
     * 部门负责人名称
     */
    @Schema(description = "部门负责人名称")
    private String leaderName = "";

    /**
     * 排序字段，用于前端展示顺序
     */
    @Schema(description = "排序")
    private Integer sortOrder = 0;

    /**
     * 部门描述或备注
     */
    @Schema(description = "部门描述或备注")
    private String description;


    public static void main(String[] args) {
        DepartmentAddDto departmentAddDto = new DepartmentAddDto();
        departmentAddDto.setCompanyId(1L);
        departmentAddDto.setDeptCode("123");
        departmentAddDto.setDeptName("123");
        departmentAddDto.setLeaderId(1L);
        departmentAddDto.setLeaderName("123");
        departmentAddDto.setSortOrder(1);
        departmentAddDto.setDescription("123");

        System.out.println(JSON.toJSONString(departmentAddDto));
    }
}